# -*- coding:utf-8 -*-
#2022/1/10 21:06
# author:xwl

from fastapi import APIRouter, Depends

from backend.app.app.api.api_Xiong.models.x_model import well_save_out_data
from backend.app.app.api.api_v1.user import verify_token_user
from backend.app.app.crud_pro.tb_userpro_out import well_out_data_add

well_out_route = APIRouter(prefix="/out", tags=["单井输出数据"])

@well_out_route.post("/save_lib",name="存库")
async def save_lib(data: well_save_out_data, ver=Depends(verify_token_user)):
    result = well_out_data_add(data.data)
    return {
        'result': result if result else {},
        'verify': ver
    }